public class QueueNode{
    private Node first=null;
    private Node last=null;
    public void add(int x){
        Node n=new Node();
        n.value=x;
        n.next=null;
        if(first==null){
            first=n;
        }
        last=n;
    }
    public int get(){
        if(first!=null){
            int x=first.value;
            first=first.next;
            System.out.println(x);
            return x;
        }else{
            System.out.println("队列空");
            return -1;
        }
    }

}
